import unittest

from bson import ObjectId

from detail import md5, parse_detail


class DetailTest(unittest.TestCase):

    def test_parse_detail(self):
        movie = {
            "_id": ObjectId("68a690af80ecbd5d1b47a302"),
            "order": 47589,
            "category": {
                "_id": ObjectId("68648bac57178fc261c16f04"),
                "url": "/mj/",
                "category": "欧美剧",
                "base_url": "https://www.hao6v.tv/"
            },
            "date": "2025-08-20",
            "title": "《异形：地球》第一季03",
            "name": "异形：地球",
            "url": "https://www.hao6v.tv/mj/2025-08-13/47589.html",
            "isRecommend": 1,
            "category_list": [
                "欧美剧"
            ],
            "updated": 1,
            "main_category": "tv",
            "md5": "f356bb540c8d3af22b0ac597c458ad3c",
            "updatedAt": "2025-08-21 11:21:19",
            "createdAt": "2025-08-21 11:21:19"
        }
        parse_detail(movie)


if __name__ == '__main__':
    unittest.main()
